﻿using log4net.Core;
using StarryEdge.Core.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace StarryEdge.ViewModels.Dialog
{
    public class MessagePopupDialog
    {
        public Visibility YesVisibility { get; set; } = Visibility.Collapsed;
        public Visibility NoVisibility { get; set; } = Visibility.Collapsed;
        public Thickness TextMessageMargin { get; set; }

        public string Title { get; set; }
        public string Message { get; set; }
        public LogLevel Level { get; set; }

        public MessagePopupDialog(string title, string message, DialogShowButton showButton, LogLevel logLevel)
        {
            Level = logLevel;
            Title = title;
            Message = message;
            TextMessageMargin = new Thickness(0, 0, 0, showButton != DialogShowButton.None ? 48 : 0);
            switch (showButton) 
            {
                case DialogShowButton.Yes:
                    YesVisibility = Visibility.Visible;
                    NoVisibility = Visibility.Collapsed;
                    break;
                case DialogShowButton.YesNo:
                    YesVisibility = Visibility.Visible;
                    NoVisibility = Visibility.Visible;
                    break;
                case DialogShowButton.No:
                    YesVisibility = Visibility.Collapsed;
                    NoVisibility = Visibility.Visible;
                    break;
            }
        }
    }
}
